'use strict';

module.exports = app => {
  const { router, controller } = app;

  // session验证中间件
  const sessionAuth = app.middleware.sessionAuth;
  // 测试路由
  router.get('/tapi/health', controller.home.health);
  router.get('/tapi//test', controller.home.test);
  router.get('/tapi/getPull', sessionAuth(), controller.home.getPull);
  router.get('/tapi/test2', sessionAuth(), controller.home.test2);



  // t 获取订单列表
  router.get('/tapi/getWorkOrders', sessionAuth(), controller.home.getWorkOrders);
  router.get('/tapi/getWorkOrder/:workcardId', sessionAuth(), controller.home.getWorkOrderById);
  router.get('/tapi/getWorkOrderPages', sessionAuth(), controller.home.getWorkOrderPages);

  // 接单
  router.post('/tapi/receiveOrder', sessionAuth(), controller.home.receiveOrder);
  // 物流取件
  router.post('/tapi/expressPickUp', sessionAuth(), controller.home.expressPickUp);
  // 服务商收取货物
  router.post('/tapi/serviceBusinessReceive', sessionAuth(), controller.home.serviceBusinessReceive);
  // 服务商更新厂内节点
  router.post('/tapi/updateNode', sessionAuth(), controller.home.updateNode);
  // 服务商服务完成，等待寄出
  router.post('/tapi/waitSend', sessionAuth(), controller.home.waitSend);
  // 服务商服务完成，已经寄出
  router.post('/tapi/serviceBusinessSendOff', sessionAuth(), controller.home.serviceBusinessSendOff);
  //  服务商服务完成，等待消费者核销  7
  router.post('/tapi/confirm', sessionAuth(), controller.home.confirm);
  // 更新状态
  router.post('/tapi/updateState', sessionAuth(), controller.home.updateState);

  // 图片上传
  router.post('/tapi/upload', sessionAuth(), controller.home.upload);
};